Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enhance(arbiter-engine): remove use of Artemis in favor of our own agent design #789

Merged
merged 14 commits into from
Jan 11, 2024

Conversation

Autoparallel
Copy link
Collaborator

Give an overview of the tasks completed
This PR started off as me just wanting to improve the Messager. Midway through, we found that dealing with Artemis was going to be quite a headache since the repo is seemingly inactive. So this PR became a lot more work. Nonetheless, we are getting close to a working different abstraction, but this does not pass completely yet.

  • Changes in arbiter-core reflect the additional feature added to the EventLogger that enables a streaming mode.

I added a decent amount of docs around arbiter-engine as to help understand the structure here.

Link to issue(s) that this PR closes

@Autoparallel Autoparallel force-pushed the arbiter-engine/enhance-messager branch from 40a773b to 1ee8c75 Compare January 10, 2024 23:43
Copy link
Collaborator

@0xJepsen 0xJepsen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm excited for this, I think we should merge it in tomorrow after standup.

My only question

  • What is the difference/relationship between running specific states (run_state) and the transition function? Is it primarily to allow for the testing and the development? When we run the sim say over a bunch of "transitions" will we need to be sure to await the transition after running a state? What is the flow you are thinking here?

@Autoparallel
Copy link
Collaborator Author

  • What is the difference/relationship between running specific states (run_state) and the transition function? Is it primarily to allow for the testing and the development? When we run the sim say over a bunch of "transitions" will we need to be sure to await the transition after running a state? What is the flow you are thinking here?

This by no means has to be the correct way to do this, but it is a working way to do things. Let's break it down for a sec and think about the Rust async model.

  1. Note that run_state() is NOT async. What happens in the run_state functions is we wrap a blocking/awaited future in a tokio::task which allows tokio to take this and run it concurrently in its runtime. In essence, run_state starts running whatever state we want it to (e.g., syncing or processing). The task is placed back into the relevant struct as a JoinHandle<..> (or a JoinAll).
  2. transition() is async and blocking. When we call transition(), we grab the Join, and await it to finish its execution and ultimately return the inner object back to the struct. For instance, for the behavior we have JoinHandle<B> and when we await this, we get back B and place this into the Engine<B, E>.

I think this could probably be simplified, but it might not matter much since on top of this we can abstract away the user ever having to call these themselves by having a manager manage worlds (or something).

@0xJepsen 0xJepsen merged commit dd87aa8 into main Jan 11, 2024
6 of 9 checks passed
@0xJepsen 0xJepsen deleted the arbiter-engine/enhance-messager branch January 11, 2024 16:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants